package com.sukaiyi.xxljob.logfinder;

import lombok.Builder;
import lombok.Data;

import java.time.LocalDateTime;
import java.util.function.Consumer;
import java.util.function.Predicate;

public interface LogFinder {


    void find(Param param, Predicate<Log> filter, Consumer<Log> consumer);


    @Data
    @Builder
    final class Param {
        private String baseUrl;
        private String username;
        private String password;
        private Integer jobGroup;
        private Integer jobId;
        private Integer logStatus;
        private LocalDateTime startFilterTime;
        private LocalDateTime endFilterTime;
    }

    @Data
    final class Log {
        private Integer id;
        private String executorAddress;
        private Integer executorFailRetryCount;
        private String executorHandler;
        private String executorParam;
        private Integer handleCode;
        private String handleMsg;
        private Long handleTime;
        private Integer jobGroup;
        private Integer jobId;
        private Integer triggerCode;
        private String triggerMsg;
        private Long triggerTime;
        private String detail;
        private String detailUrl;
    }
}
